<?php
require('lib/verify.php');
$_category = "warmath";
$_title = "Stats";
require('lib/head.php');

$forum_id = $pun_user["id"];

$sql = "select * from wm_characters where character_forum_id = '$forum_id' and character_active='1'";
$result = $db->query($sql);

$character = $db->fetch_assoc($result);

$sql = "select count(*) as n_systems from wm_systems";
$result = $db->query($sql);
$n_systems = ($db->fetch_assoc($result));
$n_systems = $n_systems["n_systems"];

$sql = "select count(*) as n_chars from wm_characters";
$result = $db->query($sql);
$n_chars = $db->fetch_assoc($result);
$n_chars = $n_chars["n_chars"];

$sql = "select count(*) from wm_characters group by character_forum_id";
$result = $db->query($sql);
$n_accs = $db->num_rows($result);

$sql = "select count(*) as n_items from wm_items";
$result = $db->query($sql);
$n_items = $db->fetch_assoc($result);
$n_items = $n_items["n_items"];

$sql = "select count(*) as n_bosses from wm_bosses";
$result = $db->query($sql);
$n_bosses = $db->fetch_assoc($result);
$n_bosses = $n_bosses["n_bosses"];

$sql = "select count(*) as n_instances from wm_instances";
$result = $db->query($sql);
$n_instances = $db->fetch_assoc($result);
$n_instances = $n_instances["n_instances"];

$sql = "select count(*) as n_credits from wm_credits";
$result = $db->query($sql);
$n_credits = $db->fetch_assoc($result);
$n_credits = $n_credits["n_credits"];

$sql = "select count(*) as n_loots from wm_loots";
$result = $db->query($sql);
$n_loots = $db->fetch_assoc($result);
$n_loots = $n_loots["n_loots"];

?>
<?php
boxTop("Warmath");
?>
There are currently <b><?=$n_systems?> systems</b> active, with <b><?=$n_chars?> characters</b> owned by <b><?=$n_accs?> accounts</b>.
<p>
Warmath is aware of <b><?=$n_items?> items</b> which can drop from <b><?=$n_bosses?> bosses</b> in <b><?=$n_instances?> instances</b>.
<p>
Warmath has seen <b><?=$n_credits?> boss kill credits</b>, resulting in <b><?=$n_loots?> items looted</b>.
<?php
boxBot();
?>
<?php
require('lib/foot.php');
?>

